Week.tsx 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. "use client";
  2. import { CashbackTypes } from "@/api/cashback";
  3. import Box from "@/components/Box";
  4. import { useLocale, useTranslations } from "next-intl";
  5. import Image from "next/image";
  6. import Extract from "./components/Extract";
  7. interface Props {
  8. cashbackInfo: CashbackTypes;
  9. }
  10. const Week = (props: Props) => {
  11. const { cashbackInfo } = props;
  12. const local = useLocale();
  13. const t = useTranslations("cashback");
  14. return (
  15. <Box className={"rounded-[0_0_20px_20px] bg-gradient-to-b from-[#fffed5] to-[#fffffe]"}>
  16. <div className={"flex"}>
  17. <div className={"flex-1"}>
  18. <h1 className={"text-[0.16rem] font-black text-[#fb8910]"}>
  19. {t("weekCashback")}
  20. </h1>
  21. <p className={"text-[0.12rem]"}>
  22. <span> {t("weekTips")} </span>
  23. <span className={"text-primary-color"}>{cashbackInfo.amount ?? "???"}</span>
  24. <span> {t("weekAfterTips")} </span>
  25. </p>
  26. </div>
  27. <div className={"relative flex-shrink-0"}>
  28. <Image
  29. src="/img/cash.png"
  30. height={100}
  31. width={100}
  32. alt="cashback"
  33. className={"ml-[0.08rem] w-[1.1rem]"}
  34. />
  35. </div>
  36. </div>
  37. <Extract cashbackInfo={cashbackInfo} local={local} />
  38. </Box>
  39. );
  40. };
  41. export default Week;